home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
vbpxen
/
return.frm
< prev
next >
Wrap
Text File
|
1995-10-23
|
5KB
|
184 lines
VERSION 2.00
Begin Form ReturnForm
Caption = "Return"
ClientHeight = 4875
ClientLeft = 1050
ClientTop = 1485
ClientWidth = 5280
Height = 5280
Left = 990
LinkMode = 1 'Source
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4875
ScaleWidth = 5280
Top = 1140
Width = 5400
Begin CommandButton ButtonCancel
Caption = "&Cancel"
Height = 615
Left = 2520
TabIndex = 2
Top = 2760
Width = 1095
End
Begin CommandButton ButtonOK
Caption = "&OK"
FontBold = -1 'True
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 9.75
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 615
Left = 120
TabIndex = 1
Top = 2760
Width = 1095
End
Begin TextBox tapenumber
Height = 375
Left = 120
TabIndex = 0
Text = " "
Top = 720
Width = 1095
End
Begin Label custname
BorderStyle = 1 'Fixed Single
Caption = " "
Height = 375
Left = 1560
TabIndex = 5
Top = 1800
Width = 3615
End
Begin Label custnumber
BorderStyle = 1 'Fixed Single
Caption = " "
Height = 375
Left = 120
TabIndex = 7
Top = 1800
Width = 1095
End
Begin Label Label1
Caption = "Customer:"
Height = 255
Left = 120
TabIndex = 3
Top = 1440
Width = 1095
End
Begin Label tapetitle
BorderStyle = 1 'Fixed Single
Height = 375
Left = 1560
TabIndex = 6
Top = 720
Width = 3615
End
Begin Label Label2
Caption = "Tape number:"
Height = 255
Left = 120
TabIndex = 4
Top = 240
Width = 1335
End
End
Sub ButtonCancel_Click ()
custname.caption = " "
custnumber.caption = " "
tapenumber.text = " "
tapetitle.caption = " "
returnform.Hide
End Sub
Sub ButtonOK_Click ()
Dim savecustnum As String
'
' Get the tape and update
'
itemrec.itemnumber = tapenumber.text
rc = GetItemRec(DBKEYED)
If rc Then
Beep
MsgBox "Tape not on database", MB_ICONINFORMATION
Exit Sub
End If
inout$ = Left$(itemrec.inout_code, 1)
If inout$ <> "O" Then
Beep
MsgBox "Tape not out", MB_ICONINFORMATION
Exit Sub
End If
custrec.custnumber = itemrec.custnum
'
' Change tape status to IN and blank custnum
'
itemrec.custnum = " "
itemrec.inout_code = "IN"
rc = UpdateItemRec()
tapetitle.caption = "OK"
iNumTapes = iNumTapes + 1
'
' Get the customer again and update as quickly
' as possible. Should lock it, but requires more code
'
rc = GetCustomerRec(DBKEYED)
custrec.tapes_out = custrec.tapes_out - 1
rc = UpdateCustomerRec()
'
' Clear the screen for the next return
'
custname.caption = " "
custnumber.caption = " "
tapenumber.text = " "
tapetitle.caption = "OK"
tapenumber.SetFocus
Exit Sub
End Sub
Sub Form_Load ()
custname.caption = " "
tapenumber.text = " "
tapetitle.caption = " "
End Sub
Sub tapenumber_LostFocus ()
If tapenumber.text = " " Then
Exit Sub
End If
itemrec.itemnumber = tapenumber.text
rc = GetItemRec(DBKEYED)
If rc Then
Beep
tapetitle.caption = "???"
Exit Sub
End If
tapetitle.caption = itemrec.itemdesc
custnumber.caption = itemrec.custnum
custrec.custnumber = itemrec.custnum
rc = GetCustomerRec(DBKEYED)
If rc Then
Beep
custname.caption = "???"
Exit Sub
End If
custname.caption = custrec.lastname
End Sub